package vn.ikame.android.boojtran.truyenbua.object;

import android.app.Activity;

import com.google.android.apps.analytics.GoogleAnalyticsTracker;

public class GA {
	public static GoogleAnalyticsTracker generalTracker;
	public static GoogleAnalyticsTracker detailTracker;

	public static void startDetail(Activity activity) {
		detailTracker = GoogleAnalyticsTracker.getInstance();
		detailTracker.startNewSession("UA-33515341-7", activity);
		detailTracker.trackTransactions();
	}

	public static void startGeneral(Activity activity) {
		generalTracker = GoogleAnalyticsTracker.getInstance();
		generalTracker.startNewSession("UA-33515341-2", activity);
		generalTracker.trackTransactions();
	}

	public static void trackGeneralView(String track) {
		generalTracker.trackPageView(track);
		generalTracker.dispatch();
	}

	public static void trackDetailView(String track) {
		detailTracker.trackPageView(track);
		detailTracker.dispatch();
	}

	public static void trackGeneralEvent(String cate, String track, int num) {
		generalTracker.trackEvent("TruyenBua", cate, track, num);
		generalTracker.dispatch();
	}

	public static void trackDetailEvent(String cate, String track, int num) {
		detailTracker.trackEvent("TruyenBua", cate, track, num);
		detailTracker.dispatch();
	}

	public static void stopDetail() {
		detailTracker.stopSession();
	}

	public static void stopGeneral() {
		generalTracker.stopSession();
	}
}
